<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<div class="desc">
			A class representing a 3x3 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].
		</div>

		<h2>Example</h2>
		<code>
var m = new Matrix3();
		</code>

		<h2>A Note on Row-Major and Column-Major Ordering</h2>
		<div>
			The [page:set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
			order, while internally they are stored in the [page:.elements elements] array in column-major order.<br /><br />

			This means that calling
		<code>
m.set( 11, 12, 13,
       21, 22, 23,
       31, 32, 33 );
		</code>
		will result in the [page:.elements elements] array containing:
		<code>
m.elements = [ 11, 21, 31,
              12, 22, 32,
              13, 23, 33 ];
		</code>
		and internally all calculations are performed using column-major ordering. However, as the actual ordering
		makes no difference mathematically and most people are used to thinking about matrices in row-major order,
		the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source
		code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
		</div>

		<h2>Constructor</h2>


		<h3>[name]()</h3>
		<div>
		Creates and initializes the [name] to the 3x3
		[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
		</div>



		<h2>Properties</h2>

		<h3>[property:Float32Array elements]</h3>
		<div>
		A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]
		 list of matrix values.
		</div>

		<h3>[property:Boolean isMatrix3]</h3>
		<div>
			Used to check whether this or derived classes are Matrix3s. Default is *true*.<br /><br />

			You should not change this, as it used internally for optimisation.
		</div>



		<h2>Methods</h2>

		<h3>[method:Array applyToBufferAttribute]( [page:BufferAttribute attribute] )</h3>
		<div>
		[page:BufferAttribute attribute] - An attribute of floats that represent 3D vectors.<br /><br />

		Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute].
		</div>


		<h3>[method:Matrix3 clone]()</h3>
		<div>Creates a new Matrix3 and with identical elements to this one.</div>

		<h3>[method:Matrix3 copy]( [page:Matrix3 m] )</h3>
		<div>Copies the elements of matrix [page:Matrix3 m] into this matrix.</div>

		<h3>[method:Float determinant]()</h3>
		<div>
		Computes and returns the
		[link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
		</div>

		<h3>[method:Boolean equals]( [page:Matrix3 m] )</h3>
		<div>Return true if this matrix and [page:Matrix3 m] are equal.</div>

		<h3>[method:Matrix3 fromArray]( [page:Array array], [page:Integer offset] )</h3>
		<div>
		[page:Array array] - the array to read the elements from.<br />
		[page:Integer offset] - (optional) index of first element in the array. Default is 0.<br /><br />

		Sets the elements of this matrix based on an array in
		[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
		</div>

		<h3>[method:Matrix3 getInverse]( [page:Matrix3 m], [page:Boolean throwOnDegenerate] )</h3>
		<div>
		[page:Matrix3 m] - the matrix to take the inverse of.<br />
		[page:Boolean throwOnDegenerate] - (optional) If true, throw an error if the matrix is degenerate (not invertible).<br /><br />

		Set this matrix to the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] of the passed matrix [page:Matrix3 m],
		using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].

		If [page:Boolean throwOnDegenerate] is not set and the matrix is not invertible, set this to the 3x3 identity matrix.
		</div>

		<h3>[method:Matrix3 getNormalMatrix]( [page:Matrix4 m] )</h3>
		<div>
		[page:Matrix4 m] - [page:Matrix4]<br /><br />

		Sets this matrix as the upper left 3x3 of the [link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix]
		of the passed [page:Matrix4 matrix4]. The normal matrix is the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] [link:https://en.wikipedia.org/wiki/Transpose transpose]
	  of the matrix [page:Matrix4 m].
		</div>

		<h3>[method:Matrix3 identity]()</h3>
		<div>
		Resets this matrix to the 3x3 identity matrix:
		<code>
1, 0, 0
0, 1, 0
0, 0, 1
		</code>

		</div>

		<h3>[method:Matrix3 multiply]( [page:Matrix3 m] )</h3>
		<div>Post-multiplies this matrix by [page:Matrix3 m].</div>

		<h3>[method:Matrix3 multiplyMatrices]( [page:Matrix3 a], [page:Matrix3 b] )</h3>
		<div>Sets this matrix to [page:Matrix3 a] x [page:Matrix3 b].</div>

		<h3>[method:Matrix3 multiplyScalar]( [page:Float s] )</h3>
		<div>Multiplies every component of the matrix by the scalar value *s*.</div>

		<h3>
			[method:Matrix3 set](
			[page:Float n11], [page:Float n12], [page:Float n13],
			[page:Float n21], [page:Float n22], [page:Float n23],
			[page:Float n31], [page:Float n32], [page:Float n33] )
		</h3>
		<div>
		[page:Float n11] - value to put in row 1, col 1.<br />
		[page:Float n12] - value to put in row 1, col 2.<br />
		...<br />
		...<br />
		[page:Float n32] - value to put in row 3, col 2.<br />
		[page:Float n33] - value to put in row 3, col 3.<br /><br />

		Sets the 3x3 matrix values to the given
		[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major]
		sequence of values.
		</div>

		<h3>[method:Matrix3 premultiply]( [page:Matrix3 m] )</h3>
		<div>Pre-multiplies this matrix by [page:Matrix3 m].</div>

		<h3>[method:Matrix3 setFromMatrix4]( [page:Matrix4 m] )</h3>
		<div>Set this matrx to the upper 3x3 matrix of the Matrix4 [page:Matrix4 m].</div>

		<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] )</h3>
		<div>
		[page:Array array] - (optional) array to store the resulting vector in. If not given a new array will be created.<br />
		[page:Integer offset] - (optional) offset in the array at which to put the result.<br /><br />

		Writes the elements of this matrix to an array in
		[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
		</div>

		<h3>[method:Matrix3 transpose]()</h3>
		<div>[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix in place.</div>

		<h3>[method:Matrix3 transposeIntoArray]( [page:Array array] )</h3>
		<div>
		[page:Array array] -  array to store the resulting vector in.<br /><br />

		[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix into the supplied array,
		and returns itself unchanged.
		</div>

		<h2>Source</h2>

		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
</html>
